package com.dtagri.fjwlw.fragment;

import com.dtagri.fjwlw.R;
import com.dtagri.fjwlw.ui.DeviceControlActivity;
import com.dtagri.fjwlw.ui.HistoricalDataActivity;
import com.dtagri.fjwlw.ui.IndexContrastActivity;
import com.dtagri.fjwlw.ui.MonitoringAlarmActivity;
import com.dtagri.fjwlw.ui.RealTimeDataActivity;
import com.dtagri.fjwlw.ui.VideoCenterActivity;

/**
 * 菜单枚举类
 * 
 * @author wxjn
 * 
 */
public enum ZMenuEnum {

	/*数据库中增加菜单，程序中也得相应增加菜单枚举*/
	MONITERINGALARM("monitoringalarm", R.drawable.icon_explore_monitoringalarm,
			MonitoringAlarmActivity.class),

	REALTIMEDATA("realtimedata", R.drawable.icon_explore_realtimedata,
			RealTimeDataActivity.class),

	DEVICECONTROL("devicecontrol", R.drawable.icon_explore_devicecontrol,
			DeviceControlActivity.class),

	HISTORICALDATA("historicaldata", R.drawable.icon_explore_historicaldata,
			HistoricalDataActivity.class),

	INDEXCONTRAST("indexcontrast", R.drawable.icon_explore_indexcontrast,
			IndexContrastActivity.class),

	VIDEOCENTER("videocenter", R.drawable.icon_explore_videocenter,
			VideoCenterActivity.class);
	

	private Class<?> clz;
	private int icon;
	private String title;

	private ZMenuEnum(String title, int icon, Class<?> clz) {
		this.clz = clz;
		this.icon = icon;
		this.title = title;
	}

	public Class<?> getClz() {
		return clz;
	}

	public void setClz(Class<?> clz) {
		this.clz = clz;
	}

	public int getIcon() {
		return icon;
	}

	public void setIcon(int icon) {
		this.icon = icon;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public static ZMenuEnum getPageByTitle(String title) {
		for (ZMenuEnum p : values()) {
			if (p.getTitle().equals(title))
				return p;
		}
		return null;
	}
}
